from common.models.department import Department

from application import db



class Formation(db.Model):
    __tablename__ = 'formation'

    id = db.Column(db.Integer, primary_key=True)
    post = db.Column(db.String(30, 'utf8mb4_0900_ai_ci'))
    depid = db.Column(db.Integer, db.ForeignKey('department.id'))
    num = db.Column(db.Integer)
    rank = db.Column(db.String(30, 'utf8mb4_0900_ai_ci'))
    department = db.relationship('Department', foreign_keys=depid)